package bd403.Backend;

/* A review class contains a rating for a Drink. A review may also contain a comment
 * with the name of the commenter for a Drink.
 * Main author: Mike
 */

public class Review {
	private int rating;
	private String comment;
	private String username;

	/*
	 * Creates a new Review with only a rating and username. Username is guaranteed
	 * to be valid at this point.
	 */
	public Review(int rating, String username) {
		this(rating, null, username);
	}
	
	/*
	 * Creates a new Review with a rating, comment, and username. Username is
	 * guaranteed to be valid at this point.
	 */
	public Review(int rating, String comment, String username) {
		this.rating = rating;
		this.comment = comment;
		this.username = username;
	}
	
	/*
	 * Only has a comment if the comment string has characters in it.
	 */
	public boolean hasComment() {
		return comment != null && !comment.equals("");
	}
	
	public int getRating() {
		return rating;
	}
	
	/*
	 * Returns the comment associated with this Review. If this Review was created
	 * with  no comment, this will return null.
	 */
	public String comment() {
		return comment;
	}
	
	/*
	 * Returns username associated with this Review
	 */
	public String getUsername() {
		return username;
	}
}
